package com.xxx;

import cn.hutool.core.util.RandomUtil;
import cn.hutool.crypto.SecureUtil;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;

import java.util.HashMap;

//声明当前类是一个SpringBoot项目的启动类
@SpringBootApplication
@EnableCaching
@MapperScan("com.xxx.**.mapper")//!!!mapper接口就不用写@Mapper注解了,统一扫描
public class BlogApp {
    public static void main(String[] args) {
        //使用启动类去启动或运行Spring程序
        SpringApplication.run(BlogApp.class,args);

        //md5算法是不可逆,不能从密文反向退出原文
        //System.out.println(SecureUtil.md5("123456"));//e10adc3949ba59abbe56e057f20f883e
        //System.out.println(SecureUtil.md5("123456"));//e10adc3949ba59abbe56e057f20f883e
        //System.out.println(SecureUtil.md5("1234567"));//fcea920f7412b5da7be0cf42b8c93759
        ////穷举法
        //HashMap<Object,Object> hm = new HashMap();
        //hm.put("e10adc3949ba59abbe56e057f20f883e", "123456");
        //hm.put("fcea920f7412b5da7be0cf42b8c93759", "1234567");
        //
        //String salt = RandomUtil.randomString(32);
        //System.out.println(salt);//0ewa1qvzgfrh9iy660ezwx5pk1bspq2p
        //
        //System.out.println(SecureUtil.md5("123456"+salt));//5b48ab9f4701da5132b4b3f4d2335dec

        //System.out.println("fcea920f7412b5da7be0cf42b8c93759".length());
    }
}

